package com.mes.service.zc;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mes.dao.zc.CustomerMapper;
import com.mes.entity.zc.CustomerDetails;
import com.mes.entity.zc.Queryzc;
/**
 * 
 * @author zc
 * 
 */
@Service
@Transactional
public class CustomerServiceImpl implements CustomerService {
	
	@Resource
	private CustomerMapper dao;
	//获取客户列表
	@Override
	public List<CustomerDetails> selectCustomerDetails(Queryzc queryzc) {
		return dao.selectCustomerDetails(queryzc);
	}
	//获取客户数量
	@Override
	public int customerCount(Queryzc queryzc) {
		return dao.customerCount(queryzc);
	}
	//通过客户名称查询当前名称在数据库的数量
	@Override
	public int selectCustomerByName(String name) {
		return dao.selectCustomerByName(name);
	}
	//添加客户
	@Override
	public int createCustomer(CustomerDetails customerDetails) {
		return dao.createCustomer(customerDetails);
	}
	//删除客户
	@Override
	public int deleteCustomer(String ids) {
		return dao.deleteCustomer(ids);
	}
	//导出所有
	@Override
	public List<CustomerDetails> selectCustomerAll() {
		return dao.selectCustomerAll();
	}
	//根据客户id查询客户
	@Override
	public CustomerDetails selectCustomerByid(long id) {
		return dao.selectCustomerByid(id);
	}
	//修改客户
	@Override
	public int editCustomer(CustomerDetails customerDetails) {
		return dao.editCustomer(customerDetails);
	}
	//查询客户是否存在于销售表
	@Override
	public int selectOrder(String ids) {
		// TODO Auto-generated method stub
		return dao.selectOrder(ids);
	}
	


}
